package com.wc.AlgoOJ_train.train1.c7.A702;

import java.util.Scanner;

/**
 * @Author congge
 * @Date 2024/1/11 9:25
 * @description 母牛的故事
 * http://43.138.190.70:8888/p/A702
 */
public class Main {
    public static void main(String[] args) {
        long[] g = new long[55];
        g[1] = 1;
        g[2] = 2;
        g[3] = 3;
        for (int i = 4; i < 55; i++) {
            g[i] = g[i - 1] + g[i - 3];
        }
        Scanner sc = new Scanner(System.in);
        while (sc.hasNextInt()){
            int n = sc.nextInt();
            if (n == 0){
                return;
            }
            System.out.println(g[n]);
        }
    }
}
